<template>
	<div class="submitChainStore">
		<div class="submitChainStore-title">北卡龙汽车膜</div>
		<div class="submitChainStore-span">北卡龙电子质保申请</div>
		<div class="shop-body">
			<div class="shop-body-flex">
				<van-field v-model="serialnumber" label="施工中心编号" placeholder="请输入施工中心编号" />
			</div>
		</div>
		<div class="red">请确认您是在上方显示的施工地址安装的北卡龙汽车膜产品</div>
		<div class="shop-button" @click="queClick()">确认</div>
		
		
		<van-dialog v-model="show" title="阅读并同意" show-cancel-button @confirm="confirmCick()" @cancel="cancelClick()">
			<a class="a" href="/book">《北卡龙个人信息处理知情并同意书》</a>
		</van-dialog>
	</div>
</template>

<script>
	import { Toast } from 'vant';
	export default {
	    data() {
			return {
				serialnumber: '',
				show: true
			}
	    },
		methods:{
			queClick(){
				let that = this;
				if(!that.serialnumber){
					Toast.fail('施工中心编号不得为空');return;
				}
				that.$http('get','/api/index/serialnumber',{'serialnumber':that.serialnumber}) .then(function (res) {
					if(res.code==1){
						that.$router.push('/submitChaindetails?serialnumber='+res.data.serialnumber);
					}else{
						Toast.fail(res.msg);return;
					}
				});
				
			},
			confirmCick(){
				this.show  = false;
				console.log(11)
			},
			cancelClick(){
				this.$router.push('/guarantee');
				console.log('取消')
			}
		}
	}
</script>

<style lang="less">
	.a {
		text-align: center;
		padding-bottom: 14px;
		padding-top: 14px;
		display: block;  
	}
	.submitChainStore {
		width: 100%;
		height: 100%;
		background-color: #fbf9fe;
		.submitChainStore-title {
			text-align: center;
			padding-top: 30px;
			font-size: 32px;
			color: #333;
		}
		.submitChainStore-span {
			text-align: center;
			color: #888;
			padding-top: 10px;
		}
		.red {
			width: 90%;
			margin: auto;
			margin-top: 20px;
			color: red;
			font-size: 14px;
			text-align: center;
		}
		
		
	}
	.van-dialog__confirm, .van-dialog__confirm:active {
		color: #04BE02;
	}
</style>